/* eslint-disable */
import request from '@/utils/request'

/**
 * 获取楼宇列表
 * @param { page, pageSize} params
 * @returns
 */
export function getBuildingListAPI(params) {
  return request({
    url: '/park/building',
    params
  })
}

/**
 * 添加楼宇
 * @param {*} data
 * @returns
 */
export function createBuildingListAPI(data) {
  return request({
    url: '/park/building',
    method: 'POST',
    data
  })
}

/**
 * 删除楼宇
 * @param {*} data
 * @returns
 */
export function delBuildingListAPI(id) {
  return request({
    url: `/park/building/${id}`,
    method: 'DELETE'
  })
}


/**
 * 编辑楼宇信息
 * @param {Object} data - 楼宇数据
 * @returns {Promise}
 */
export function editBuildingListAPI(data) {
  const { id, name, floors, area, propertyFeePrice } = data
  return request({
    url: `/park/building/${id}`,
    method: 'put',
    data: {
      name,
      floors,
      area,
      propertyFeePrice
    }
  })
}

